<template>
  <div id="MyFileDrawnerPanel">
    <el-drawer title="我的文件" v-model="drawerVisible" 
    :direction="direction" :before-close="handleClose" 
    :destroy-on-close=true
    @opened="onOpened">
      <FileCardList ref="refFileCardList"/>
    </el-drawer>
  </div>
</template>
  
<script setup>
import FileCardList from './FileCardList.vue'
import { ref } from 'vue'

const drawerVisible = ref(false)
const direction = ref('rtl')
const refFileCardList = ref(null)

const onOpened = () => {
  refFileCardList.value.getAllFiles();
}

const handleClose = (done) => {
  done();
  // this.$confirm('确认关闭？')
  //   .then(_ => {
  //     done();
  //   })
  //   .catch(_ => {});
}

defineExpose({
  drawerVisible
});
</script>
  
<style scoped>
</style>
  